package god530.com.simpleapp_slide.account.tabs.account.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by root on 16-1-31.
 */
public class AccountModel implements Parcelable{

    private int id;
    private String key;
    private String value;
    private double money;

    protected AccountModel(Parcel in) {
        id = in.readInt();
        key = in.readString();
        value = in.readString();
        money = in.readDouble();
    }

    public AccountModel(String key, String value, double money) {
        this.key = key;
        this.value = value;
        this.money = money;
    }

    public AccountModel(int id, String key, String value, double money) {
        this.id = id;
        this.key = key;
        this.value = value;
        this.money = money;
    }

    public AccountModel() {
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public int getId() {
        return id;
    }

    public String getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

    public double getMoney() {
        return money;
    }

    public static final Creator<AccountModel> CREATOR = new Creator<AccountModel>() {
        @Override
        public AccountModel createFromParcel(Parcel in) {
            return new AccountModel(in);
        }

        @Override
        public AccountModel[] newArray(int size) {
            return new AccountModel[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(key);
        dest.writeString(value);
        dest.writeDouble(money);
    }

    @Override
    public String toString() {
        return "AccountModel{" +
                "id=" + id +
                ", key='" + key + '\'' +
                ", value='" + value + '\'' +
                ", MONEY=" + money +
                '}';
    }
}
